import { lazy } from "react";
import App from "../App";
import { createBrowserRouter } from 'react-router-dom'
const Home = lazy(() => import('../pages/home/Index'))
const List = lazy(() => import('../pages/list/Index'))
const Android = lazy(() => import('../pages/android/Index'))
const Ios = lazy(() => import('../pages/ios/Index'))
const Ai = lazy(() => import('../pages/ai/Index'))
const Index = lazy(() => import('../pages/index/Index'))
const Login = lazy(() => import('../pages/login/Index'))
const Timez = lazy(() => import('../pages/timez/Index'))
const Detail = lazy(() => import('../pages/detail/Index'))
export const homeRouter = [
    {
        label: '关注',
        path: '/home',
        element: <Home />
    },
    {
        label: '综合',
        path: '/list',
        element: <List />
    },
    {
        label: '时间轴',
        path: '/timez',
        element: <Timez />
    },
    {
        label: 'Android',
        path: '/android',
        element: <Android />
    },
    {
        label: 'IOS',
        path: '/ios',
        element: <Ios />
    },
    {
        label: '人工智能',
        path: '/ai',
        element: <Ai />
    },
    {
        label: '开发工具',
        path: '/index',
        element: <Index />
    }
]
const router = [
    {
        path: '/',
        element: <App />,
        children: homeRouter
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/detail',
        element: <Detail />
    }
]
const routes = createBrowserRouter(router)
export default routes